<?
global $config,$db;
$e = $params;
$link = $e["link"];

if ($_FILES["file"]) {
	$file = $_FILES["file"];
	$md5 = md5("$link/{$e["id"]}");
	move_uploaded_file($file["tmp_name"],"{$config["wiki.datadir"]}/$md5");
	$e = array(
		"fname"=>$md5,
		"link"=>$link,
		"changes"=>$_POST["changes"],
		);
	_wiki_insert($e);
	}

echo "<img src=\"view.php?link=$link\">";

inc_incfile("form3.php",array(
	"fields"=>array(
		"file"=>array(
			"type"=>"file",
			"title"=>"File",
			),
		"changes"=>array(
			"type"=>"default",
			"title"=>"Changes",
			),
		),
	"upload"=>1,
	"actions"=>array(
		"Continue"=>"",
		),
	));
?>